<?php
namespace app\admin\validate;
use think\Validate;

/**
 * 模块信息验证器
 * Created by PhpStorm.
 * User: tyll
 * Date: 2019/09/18
 * Time: 15:10
 */
class Modular extends Validate{

    protected $rule = [
        'regionid' => 'require',
        'name'     => 'require',
        'm_data'   => 'require|array'
    ];

    protected $message = [
        'regionid.require' => '区域必须填写',
        'name.require'     => '模块名称必须填写',
        'm_data.require'   => '模块必须填写',
        'm_data.array'     => '模块填写错误'
    ];

    protected $scene = [
        'add'  => ['regionid','m_data'],
        'edit' => ['regionid','name']
    ];
}